package Code;

import java.util.List;

public class OccGrid {
	private Point location;
	private int xLength;
	private int yLength;
	private int[][] grid;
	
	public OccGrid(Point location, int xlength, int ylength, List<String[]> list) {
		this.location = location;
		this.xLength = xlength;
		this.yLength = ylength;
		grid = new int[xlength][ylength];
		for(int x = 0; x < xLength; x++) {
			for(int y = 0; y < yLength; y++) {
				grid[x][y] = Character.getNumericValue(list.get(x)[0].charAt(y));
			}
		}
	}
	
	public Point getLocation() {
		return location;
	}
	
	public int getXLength() {
		return xLength;
	}
	
	public int getYLength() {
		return yLength;
	}
	
	public int getValue(int x, int y) {
		return grid[x][y];
	}
	
	public boolean getHit(int x, int y) {
		return grid[x][y] == 1;
	}
	
	
}
